package day4;

import java.util.Arrays;

public class Test7 {
    public static void main(String[] args) {
        int[] array = {5, 2, 6, 5, 9, 0, 3};
        //插入排序
        for (int i = 1; i < array.length; i++) {
            for (int j = i; j >0 ; j--) {
                if(array[j]<array[j-1]){
                    int temp = array[j];
                    array[j]= array[j-1];
                    array[j-1] = temp;
                }else {
                    break;
                }
            }
            
        }
        System.out.println(Arrays.toString(array));
    }
}
